package hfjava;

import java.util.Arrays;
import java.util.Scanner;

public class Scores_5 {
    public static void main(String[] args) {
        int[][] arr= new int[3][5];
        int[] arr_1=new int[3];
        int sum=0;
        int sum1=0;
        Scanner input=new Scanner(System.in);
        System.out.println("你想知道哪门成绩平均分");

        int n=input.nextInt();
        for (int i = 0; i <arr.length ; i++) {
            for (int j = 0; j <arr[i].length ; j++) {
                arr[i][j]=(int)(Math.random()*100);
                sum+= arr[i][j];
            }
            sum1+=arr[i][n];
            for (int j = 0; j <arr_1.length ; j++) {
                arr_1[j]=sum;
            }
            System.out.println(Arrays.toString(arr[i]));
        }
        System.out.println("三个同学总分分别为："+Arrays.toString(arr_1));
        System.out.println("你想知道的成绩平均分为："+sum1);
    }
}
